<h1 class="page-header">
    <small>核销用户卡券</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-1">
    <div class="panel-heading">
        <h4 class="panel-title">会员用户信息表单</h4>
    </div>
    <div class="panel-body">
        <form class="form-horizontal" id="memberForm" name="memberForm" action="" method="post">
            <div class="form-group">
                <label class="col-md-3 control-label">用户手机号：</label>

                <div class="col-md-9">
                    <input type="hidden" id="id"  name="id" placeholder="用户卡券id" value="${uvCounponInfo.id}">
                    <label>${uvCounponInfo.mobile}</label>
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-9">
                <label class="col-md-3 control-label">卡券名称：</label>

                    <label>${uvCounponInfo.couponName}</label>
                </div>
            </div>

            <div class="form-group">
                        <select class="form-control" name="storeId" id="storeId">
                            <option value="">使用店铺</option>
                            <#if storeList?has_content && storeList?exists>
                            <#list storeList as pf>
                            <option value="${pf.id}">${pf.name}</option>
                        </#list>
                    </#if>
                    </select>
            </div>
<div class="form-group">
    <label class="col-md-3 control-label"></label>

    <div class="col-md-9">
        <button type="button" id="submitButton" class="btn btn-sm btn-success">提交</button>
    </div>
</div>
</form>
</div>
</div>
<script type="application/javascript">
    $(function () {
        $('#submitButton').click(function () {
            $('#memberForm').submit();
        });

        $('#memberForm').validate({
            rules: {
                storeId: {
                    required:true
                }

            },
            messages: {
                storeId: {
                    required : "必须选择一个店铺"
                }
            },
            errorPlacement: function (error, element) {
                error.appendTo(element.parent());
            },
            submitHandler: function () {
                //var selectNode = $.selectedTreeNode();
                // alert("test");
                postDataByFormParams('${rc.contextPath}/backend/member/confirmerUserCoupon', 'displayArea', 'memberForm');

                parent.layer.closeAll();
            }
        })
    })
</script>

